﻿
namespace RockPaperScissors.Web.Utility.Tests
{
    using GravityWorks.RockPaperScissors.Toolkit;
    
    public static class ExtenstionMethods
    {
        public static GameLog CreateGameLogWithNoDynamiteLeftForTeam(this GameLog log, string teamName, int amountOfDynamiteToMock) 
        { 
            GameLog tmpRtn = new GameLog();

            for (int i = 1; i <= amountOfDynamiteToMock; i++)
            {
	            ContestMatch match = new ContestMatch();
                match.TeamName1 = teamName;
                match.TeamName2 = teamName;
                match.Team1Move = MoveType.Dynamite;
                match.Team2Move = MoveType.Dynamite;
             
                tmpRtn.Log.Add(match);
            }

            
            // return
            return tmpRtn;
        }

        public static RuleSet CreateRuleSet(this RuleSet set, bool canThrowRock, bool canThrowScissors, bool canThrowPaper, bool canThrowDynamite, int maxOfDynamite)
        {
            RuleSet tmpRtn = new RuleSet();

            tmpRtn.CanThrowRock = canThrowRock;
            tmpRtn.CanThrowPaper = canThrowScissors;
            tmpRtn.CanThrowScissors = canThrowPaper;
            tmpRtn.CanThrowDynamite = canThrowDynamite;
            tmpRtn.NumberOfDynamite = maxOfDynamite;

            // return
            return tmpRtn;
        }
    }
}